package HomeWork2;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;

public class d0326HomeWork {
    public static void main(String[] args) throws Exception {

        String str[]=new String[]{"abstract","assert","boolean","break","byte","case","catch","char","class","continue","default","do","double","else","enum","extends","final","finally","float","for","if","implements","import","int","interface","instanceof","long","native","new","package","private","protected","public","return","short","static","strictfp","super","switch","synchronized","this","throw","throws","transient","try","void","volatile","while"};

        File fl=new File("D:/a.txt");
        FileReader fr=new FileReader(fl);
        BufferedReader br=new BufferedReader(fr);
        String str1[]=br.readLine().split(" ");
        int num[]=new int[str.length];
        for (String str2 : str1) {
            for (int i = 0;i < str.length;i++) {
                if(str2.equals(str[i])) {
                    num[i]++;
                }
            }
        }
        for(int i = 0; i < str.length;i++) {
            if(num[i]!=0) {
                System.out.println("JAVA关键词："+str[i]+" 出现次数："+num[i]);
            }
        }
    }
}
